/*
 *  Workout.h
 *  Workout
 *
 *  Created by Acroname on 4/28/10.
 *
 */

#ifndef _Workout_H_
#define _Workout_H_

#include "Exercise.h"

#define WORKOUT_MAX_EXERCISES 15



class Workout {
public:
  
  Workout(void);
  //Workout(int date, float p, const char * d);
  ~Workout(void) {};
  
  const char * WorkoutShowDetails(OutputType t, FILE *pFile = NULL);
  
  //void AddExercise(ExerciseType e);
  
  void AddExercise(ExerciseType e,
		   setType s,
		   int goalWeight,
		   const int time = 0,
		   weightCalcProc calcProc = calcFlat,
		   exerciseFilterProc exFilter = filterNothing, 
		   bool optional = false,
		   float fBaseCalcPercent = 0.6f);
  
  void AddExercise(ExerciseType e,
		   const int sets,
		   const int *reps,
		   int goalWeight,
		   const int time = 0,
		   weightCalcProc calcProc = calcFlat,
		   exerciseFilterProc exFilter = filterNothing, 
		   bool optional = false,
		   float fBaseCalcPercent = 0.6f);
  
  inline int WorkoutGetDate(void) { return m_date; };
  inline int WorkoutGetExercises(void) {return m_nExercises; };
  
  inline void WorkoutSetDateSetExerciseFilter(exerciseFilterProc f) { m_pFilterProc = f; };
  inline void WorkoutSetDateSetCalcFilter(weightCalcProc f) { m_pCalcProc = f; };
  
  inline void WorkoutSetDate(int date) { m_date = date; };
  inline void WorkoutSetPercentofMax(const float p) { m_fPercentMax = p; };
  
  inline void WorkoutSetDescription(const char * s) { sprintf(m_description, "%s", s); };
  
  inline void WorkoutSetOptionalExercise(int ex, bool b) {
    m_exercise[ex].SetOptional(b);
  };
  
private:
  Exercise m_exercise[WORKOUT_MAX_EXERCISES];
  
  inline int WorkoutGetNumberSets(int ex) {
    return m_exercise[ex].GetNumberOfSets();
  };
  
  int m_date;
  int m_time;
  int m_nExercises;
  char m_description[50];
  float m_fPercentMax;
  setType m_settype;
  weightCalcProc m_pCalcProc;
  exerciseFilterProc m_pFilterProc;
	float m_fCalcBasePercent;
  
};

#endif

